{% extends "base.html" %}
{% block menu %}
 <div class="navbar navbar-inverse navbar-fixed-top">
      <div class="navbar-inner">
        <div class="container">
          <button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
          <a class="brand" href="#">Project Manager System</a>
          <div class="nav-collapse collapse">
            <ul class="nav">
              <li class="active"><a href="/admrol/{{session['faseid']}}">Administrar Rol</a></li>
              <li><a href="/">Logout</a></li>
              <li><a href="#contact">Usuario: {{session['username']}}</a></li>
              </ul>
          </div>
       </div>
     </div>
</div>

{%endblock%}

{%block mensaje%}
	{% with messages = get_flashed_messages() %}
	  {% if messages %}
	    <ul class=flashes>
	    {% for message in messages %}
	      <li>{{ message }}</li>
	    {% endfor %}
	    </ul>
	  {% endif %}
	{% endwith %}
{%endblock%}
{%block content%}

<div class="usuarios">
	<div class="row">
      <div class="span12">
      <h3 class="muted" align="center">{{session['proyectonombre']}} - {{session['fasenombre']}}</h3>
        <h2> Listado de Usuarios </h2>
        <table class="table table-striped table-bordered">
          <tr>
            <th>Nro</th>
            <th>Nombre</th>
            <th>Nombre Usuario </th>
            <th>Administrador</th>
            <th>Asignar</th>
          </tr>
          {% for u in usuarios %}
          <tr>
          <form></form>
            <td>{{u.id}}</td>
            <td>{{u.nombre}}</td>
            <td>{{u.nombredeusuario}}</td>
            {% if u.isAdmin %}
            <td>Si</td>
            {% else %}
            <td>No </td>
			{% endif %}
            <td>
            <a class="btn" href="/admrol/desasignarrol/{{u.id}}">Desasignar</a>
            </td>
          </tr>
          
          {% else %}
          	<tr>
          		No hay usuarios que posean el rol
          	</tr>
          {% endfor %}
          
        </table>
        <a class="btn btn-success" href="/admrol/{{session['faseid']}}">Aceptar</a>
      	</div>  
 </div>
 
{%endblock%}



